from bs4 import BeautifulSoup
html_doc=""
with open('htmlcolor.html','r',encoding='utf-8') as file:
    html_doc=file.read()
soup=BeautifulSoup(html_doc,'lxml')
h2s=soup.find_all('h2')
for h2 in h2s:
    print(soup.find(f'h2["{h2.get_text()}"]'))
